Skip to content

Improve tracing options in JobManager and DeadlockDetector#2587

Merged
fedejeanne merged 3 commits intoeclipse-platform:masterfrom
vi-eclipse:tracing_JobManager
Mar 25, 2026
Merged

Improve tracing options in JobManager and DeadlockDetector#2587
fedejeanne merged 3 commits intoeclipse-platform:masterfrom
vi-eclipse:tracing_JobManager

Conversation

@fedejeanne
Copy link
Copy Markdown
Member

@fedejeanne fedejeanne commented Mar 24, 2026

Add the following to the .options file so that one can choose to trace these events via the preferences (General > Tracing):

  • jobs/yielding
  • jobs/yielding/detailed
  • jobs/blockedunblocked

Do not log to sysout for the preference "jobs/locks", use the same method as other tracers.

Show the name of system jobs that block other jobs in JobManager.reportBlocked(...)

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the observability of job scheduling/locking behavior in org.eclipse.core.jobs by expanding trace options and routing deadlock/lock diagnostics through the standard tracing mechanism instead of System.out.

Changes:

  • Adds new trace options (jobs/yielding, jobs/yielding/detailed, jobs/blockedunblocked) to the bundle’s .options so they can be toggled via Eclipse tracing preferences.
  • Replaces System.out.println calls in DeadlockDetector with JobManager.debug(...) for consistency with existing tracing.
  • Updates JobManager.reportBlocked(...) to include the blocking job’s name in the blocked message.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
runtime/bundles/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/JobManager.java Changes blocked-status reporting to name the blocking job (but currently also changes the status type/contents).
runtime/bundles/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/DeadlockDetector.java Routes lock/deadlock debug output through the bundle debug trace mechanism.
runtime/bundles/org.eclipse.core.jobs/.options Exposes additional tracing toggles via the Eclipse “General > Tracing” UI.
Comments suppressed due to low confidence (1)

runtime/bundles/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/JobManager.java:1403

  • reportBlocked now creates a JobStatus (exposing the blocking Job via IJobStatus#getJob()) for all blocking jobs. Previously, system jobs and ThreadJob blockers were intentionally mapped to a plain Status to avoid leaking internal/system jobs to progress monitors and to avoid confusing names like "Implicit Job" in the user-facing message.

Consider restoring the special-casing at least for ThreadJob (and possibly isSystem()), while still including the blocker’s name in the message if desired. A safe approach is to always build the message, but only wrap it in JobStatus for non-system, non-ThreadJob jobs; otherwise use a plain Status so clients can’t obtain the internal job instance from the blocked reason.

		InternalJob blockingJob = blockingJobs.stream().sorted(Comparator.comparing(InternalJob::isSystem)).findFirst()
				.orElse(null);
		if (blockingJob == null) {
			reason = new Status(IStatus.INFO, JobManager.PI_JOBS, 1, JobMessages.jobs_blocked0, null);
		} else {
			String msg = NLS.bind(JobMessages.jobs_blocked1, blockingJob.getName());
			reason = new JobStatus(IStatus.INFO, (Job) blockingJob, msg);
		}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 24, 2026

Test Results

    54 files  ±0      54 suites  ±0   35m 49s ⏱️ +14s
 4 546 tests ±0   4 523 ✅ +1   23 💤 ±0  0 ❌  - 1 
12 234 runs  ±0  12 075 ✅ +1  159 💤 ±0  0 ❌  - 1 

Results for commit d47e41e. ± Comparison against base commit 2222ff6.

♻️ This comment has been updated with latest results.

@eclipse-platform-bot
Copy link
Copy Markdown
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

runtime/bundles/org.eclipse.core.jobs/META-INF/MANIFEST.MF

Warning

🚧 This PR cannot be modified by maintainers because edits are disabled or it is created from an organization repository. To obtain the required changes apply the git patch manually as an additional commit.

Git patch
From 47bd0ff4503b093a7bea9f295b7b14c78305e857 Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <platform-bot@eclipse.org>
Date: Tue, 24 Mar 2026 11:51:08 +0000
Subject: [PATCH] Version bump(s) for 4.40 stream


diff --git a/runtime/bundles/org.eclipse.core.jobs/META-INF/MANIFEST.MF b/runtime/bundles/org.eclipse.core.jobs/META-INF/MANIFEST.MF
index 1991fbccb9..be708b1eea 100644
--- a/runtime/bundles/org.eclipse.core.jobs/META-INF/MANIFEST.MF
+++ b/runtime/bundles/org.eclipse.core.jobs/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.core.jobs; singleton:=true
-Bundle-Version: 3.15.700.qualifier
+Bundle-Version: 3.15.800.qualifier
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Export-Package: org.eclipse.core.internal.jobs;x-internal:=true,
-- 
2.53.0

Further information are available in Common Build Issues - Missing version increments.

Add the following to the .options file so that one can choose to trace
these events via the preferences (General > Tracing):
- jobs/yielding
- jobs/yielding/detailed
- jobs/blockedunblocked

Do not log to sysout for the preference "jobs/locks", use the same
method as other tracers.

Show the name of system jobs that block other jobs in
JobManager.reportBlocked(...)
@fedejeanne
Copy link
Copy Markdown
Member Author

If there are no objections, I plan to merge this week

Do not set them to false if they are not explicitly set in the
configuration, leave them as they are. This avoids the duplicated logic
of declaring them as "false" when they are declared and also when they
are loaded.
@fedejeanne fedejeanne merged commit 364d6d5 into eclipse-platform:master Mar 25, 2026
18 checks passed
@fedejeanne fedejeanne deleted the tracing_JobManager branch March 25, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants